public class State implements Comparable<State>
{
    private int seats = 1;
    private int population;
    private double priority;
    private String stateName;
    
    public State(String stateName, int population)
    {
        this.stateName = stateName;
        this.population = population;
        calcPriority();
    }
    
	@Override
    public int compareTo(State s)
    {
        if(getPriority() > s.getPriority()) return 1;
        if(getPriority() < s.getPriority()) return -1;
        return 0;
    }
    
    private void calcPriority()
    {
        priority = population/(Math.sqrt(seats*(seats+1)));
    }
    
    public void increaseSeats()
    {
        seats++;
        calcPriority();
    }
    
    public double getPriority()
    {
        return priority;
    }
    
    public int getSeats()
    {
        return seats;
    }

	public String getName()
	{
		return stateName;
	}
}